10dof 2.2.0
10dof


10DOF Click

10DOF Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : I2C type

Software Support

Example Description

This is a example which demonstrates the use of 10DOF Click board. It measures temperature, humidity and pressure data from the BME180 chip sensor and accel, gyro and magnetometar coordinates values for X-axis, Y-axis and Z-axis.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.10Dof

Example Key Functions

Application Init

Initialize the driver and sets the default configuration of BMP180 and BNO055 chip.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
C10DOF_MAP_MIKROBUS( cfg, MIKROBUS_1 );
c10dof_init( &c10dof, &cfg );
c10dof_default_cfg( &c10dof );
}
#define C10DOF_MAP_MIKROBUS(cfg, mikrobus)
Definition c10dof.h:67
void application_init(void)
Definition main.c:56

Application Task

Displays temperature, humidity and pressure data from the BMP180 and BNO055 sensors.

void application_task ( void )
{
c10dof_read_accel( &c10dof, &accelX, &accelY, &accelZ );
Delay_ms ( 10 );
c10dof_read_gyro( &c10dof, &gyroX, &gyroY, &gyroZ );
Delay_ms ( 10 );
c10dof_read_mag( &c10dof, &magX, &magY, &magZ );
Delay_ms ( 10 );
temperature = c10dof_get_temperature( &c10dof );
Delay_ms ( 10 );
c10dof_get_measurements( &c10dof, &temperature, &pressure );
Delay_ms ( 10 );
log_printf( &logger, "Accel X : %d | ", accelX );
log_printf( &logger, "Gyro X : %d | ", gyroX );
log_printf( &logger, "Mag X : %d | ", magX );
log_printf( &logger, "Temp. : %.2f C \r\n", temperature, deg_cel);
log_printf( &logger, "Accel Y : %d | ", accelY);
log_printf( &logger, "Gyro Y : %d | ", gyroY);
log_printf( &logger, "Mag Y : %d | \r\n", magY);
log_printf( &logger, "Accel Z : %d | ", accelZ);
log_printf( &logger, "Gyro Z : %d | ", gyroZ);
log_printf( &logger, "Mag Z : %d | ", magZ);
log_printf( &logger, "Press. : %.2f mbar \r\n", pressure);
log_printf( &logger, "--------------------------------------------------------------------\r\n", pressure);
Delay_ms ( 500 );
}
void c10dof_get_measurements(c10dof_t *ctx, float *temperature, float *pressure)
Get measurements value - temperature and pressure data function.
void c10dof_read_gyro(c10dof_t *ctx, int16_t *gyroX, int16_t *gyroY, int16_t *gyroZ)
Function read Gyro X-axis, Y-axis and Z-axis axis.
void c10dof_read_mag(c10dof_t *ctx, int16_t *magX, int16_t *magY, int16_t *magZ)
Function read Magnetometar X-axis, Y-axis and Z-axis.
void c10dof_read_accel(c10dof_t *ctx, int16_t *accelX, int16_t *accelY, int16_t *accelZ)
Function read Accel X-axis, Y-axis and Z-axis.
float c10dof_get_temperature(c10dof_t *ctx)
Get temperature value function.
void application_task(void)
Definition main.c:82

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.